/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 841756
 */
@Entity
@Table(name = "tblconceptodeduccionretefuente")
@NamedQueries({
    @NamedQuery(name = "Tblconceptodeduccionretefuente.findAll", query = "SELECT t FROM Tblconceptodeduccionretefuente t"),
    @NamedQuery(name = "Tblconceptodeduccionretefuente.findByCodConceptodeduccion", query = "SELECT t FROM Tblconceptodeduccionretefuente t WHERE t.codConceptodeduccion = :codConceptodeduccion"),
    @NamedQuery(name = "Tblconceptodeduccionretefuente.findByNomConceptodeduccion", query = "SELECT t FROM Tblconceptodeduccionretefuente t WHERE t.nomConceptodeduccion = :nomConceptodeduccion"),
    @NamedQuery(name = "Tblconceptodeduccionretefuente.findByLimite", query = "SELECT t FROM Tblconceptodeduccionretefuente t WHERE t.limite = :limite"),
    @NamedQuery(name = "Tblconceptodeduccionretefuente.findByTipo", query = "SELECT t FROM Tblconceptodeduccionretefuente t WHERE t.tipo = :tipo")})
public class Tblconceptodeduccionretefuente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "cod_conceptodeduccion")
    private String codConceptodeduccion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nom_conceptodeduccion")
    private String nomConceptodeduccion;
    @Basic(optional = false)
    @NotNull
    @Column(name = "limite")
    private double limite;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "tipo")
    private String tipo;
    @JoinColumn(name = "cod_compania", referencedColumnName = "cod_compania")
    @ManyToOne(optional = false)
    private Tblcompania codCompania;
    @JoinColumn(name = "id_estado", referencedColumnName = "id_estado")
    @ManyToOne(optional = false)
    private TblEstado idEstado;

    public Tblconceptodeduccionretefuente() {
    }

    public Tblconceptodeduccionretefuente(String codConceptodeduccion) {
        this.codConceptodeduccion = codConceptodeduccion;
    }

    public Tblconceptodeduccionretefuente(String codConceptodeduccion, String nomConceptodeduccion, double limite, String tipo) {
        this.codConceptodeduccion = codConceptodeduccion;
        this.nomConceptodeduccion = nomConceptodeduccion;
        this.limite = limite;
        this.tipo = tipo;
    }

    public String getCodConceptodeduccion() {
        return codConceptodeduccion;
    }

    public void setCodConceptodeduccion(String codConceptodeduccion) {
        this.codConceptodeduccion = codConceptodeduccion;
    }

    public String getNomConceptodeduccion() {
        return nomConceptodeduccion;
    }

    public void setNomConceptodeduccion(String nomConceptodeduccion) {
        this.nomConceptodeduccion = nomConceptodeduccion;
    }

    public double getLimite() {
        return limite;
    }

    public void setLimite(double limite) {
        this.limite = limite;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    public Tblcompania getCodCompania() {
        return codCompania;
    }

    public void setCodCompania(Tblcompania codCompania) {
        this.codCompania = codCompania;
    }

    public TblEstado getIdEstado() {
        return idEstado;
    }

    public void setIdEstado(TblEstado idEstado) {
        this.idEstado = idEstado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codConceptodeduccion != null ? codConceptodeduccion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tblconceptodeduccionretefuente)) {
            return false;
        }
        Tblconceptodeduccionretefuente other = (Tblconceptodeduccionretefuente) object;
        if ((this.codConceptodeduccion == null && other.codConceptodeduccion != null) || (this.codConceptodeduccion != null && !this.codConceptodeduccion.equals(other.codConceptodeduccion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "" + nomConceptodeduccion + "";
    }
    
}
